﻿@model Tuple<deviceManage.Models.DeviceType,List<deviceManage.Models.DeviceTypeCategory>>
@{
  Layout = null;
} 

<div class="layui-form" lay-filter="editForm" style="padding: 20px 30px 0 0;">
    <input type="hidden" name="id" value="@Model.Item1.Id" />
    <div class="layui-form-item">
        <label class="layui-form-label">类型名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" value="@Model.Item1.Name" lay-verify="required" placeholder="请输入设备类型" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属分类</label>
        <div class="layui-input-inline">
            <select name="DeviceTypeCategoryId">
                <option></option>
                @foreach (var item in Model.Item2)
                {
                    @if (Model.Item1.DeviceTypeCategoryId!= null &&  Model.Item1.DeviceTypeCategoryId.Equals(item.Id))
                    {
                        <option value="@item.Id" selected>@item.Name</option>
                    }
                    else
                    {
                        <option value="@item.Id" >@item.Name</option>
                    }
                }
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <input type="text" name="sortOrder" value="@Model.Item1.SortOrder" lay-verify="number" placeholder="请输入序号" autocomplete="off" class="layui-input">
            <h5>序号越小越靠前</h5>
        </div>
    </div>

    <div class="layui-form-item center">
        <input type="button" lay-submit="" lay-filter="edit" value="确认" class="layui-btn">
    </div>
</div>